﻿using Core.Database;
using Core.Info;
using Entity.Core;
using FreeSql.DataAnnotations;
using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;
using System.Runtime.InteropServices;

/*
 * @生成日期 : 2022-11-10
 * @生成说明 : 应用配置
 */
namespace Entity.Core.Config
{
    /// <summary>
    /// 接口配置参数 , 表： api_config_param
    /// </summary>
    [JsonObject(MemberSerialization.OptIn), Table(Name = "api_config_param")]
    [Index($"uk_api_config_param_sid", "sid", true)]
    //[Index($"uk_app_config_sid", "sid", true)]
    public class ApiConfigParamEntity : CommonBaseEntity, ILocalDataStorageEntity
    {

        #region 属性

        // 忽略生成字段 - id - 自增主键;数据库的自增主键

        // 忽略生成字段 - sid - 雪花Id，所有的外键均使用该字段

        #region 接口采集配置Id;api_config.id

        /// <summary>
        /// 接口采集配置Id;api_config.id
        /// </summary>
        [JsonProperty("fk_config_sid", Order = 2)]
        [Column(Name = "fk_config_sid", Position = 2)]
        [Display(Name = "接口采集配置Id")]
        public virtual long? FkConfigSid { get; set; }

        #endregion 接口采集配置Id;api_config.id


        #region 上级参数Sid;api_config_param.id

        /// <summary>
        /// 上级参数Sid;api_config_param.id
        /// </summary>
        [JsonProperty("parent_sid", Order = 3)]
        [Column(Name = "parent_sid", Position = 3)]
        [Display(Name = "上级参数Sid")]
        public virtual long? ParentSid { get; set; }

        #endregion 上级参数Sid;api_config_param.id


        #region 参数分组键

        /// <summary>
        /// 参数分组键
        /// </summary>
        [JsonProperty("param_group_key", Order = 4)]
        [Column(Name = "param_group_key", StringLength = 256, Position = 4)]
        [Display(Name = "参数分组键")]
        public virtual string? ParamGroupKey { get; set; }

        #endregion 参数分组键


        #region 参数分组名称

        /// <summary>
        /// 参数分组名称
        /// </summary>
        [JsonProperty("param_group_name", Order = 5)]
        [Column(Name = "param_group_name", StringLength = 256, Position = 5)]
        [Display(Name = "参数分组名称")]
        public virtual string? ParamGroupName { get; set; }

        #endregion 参数分组名称


        #region 参数类型

        /// <summary>
        /// 参数类型
        /// </summary>
        [JsonProperty("param_type", Order = 6)]
        [Column(Name = "param_type", StringLength = 64, Position = 6)]
        [Display(Name = "参数类型")]
        public virtual string? ParamType { get; set; }

        #endregion 参数类型


        #region 参数名称

        /// <summary>
        /// 参数名称
        /// </summary>
        [JsonProperty("param_name", Order = 7)]
        [Column(Name = "param_name", StringLength = 90, Position = 7)]
        [Display(Name = "参数名称")]
        public virtual string? ParamName { get; set; }

        #endregion 参数名称


        #region 参数键

        /// <summary>
        /// 参数键
        /// </summary>
        [JsonProperty("param_key", Order = 8)]
        [Column(Name = "param_key", StringLength = 128, Position = 8)]
        [Display(Name = "参数键")]
        public virtual string? ParamKey { get; set; }

        #endregion 参数键


        #region 参数值

        /// <summary>
        /// 参数值
        /// </summary>
        [JsonProperty("param_value", Order = 9)]
        [Column(Name = "param_value", StringLength = -1, Position = 9)]
        [Display(Name = "参数值")]
        public virtual string? ParamValue { get; set; }

        #endregion 参数值


        #region 参数说明

        /// <summary>
        /// 参数说明
        /// </summary>
        [JsonProperty("param_description", Order = 10)]
        [Column(Name = "param_description", StringLength = 900, Position = 10)]
        [Display(Name = "参数说明")]
        public virtual string? ParamDescription { get; set; }

        #endregion 参数说明

        // 忽略生成字段 - sort_number - 排序号

        // 忽略生成字段 - remark - 备注

        // 忽略生成字段 - created_by - 创建人

        // 忽略生成字段 - created_by_name - 创建人名称;创建人名称冗余存储

        // 忽略生成字段 - created_time - 创建时间

        // 忽略生成字段 - updated_by - 更新人

        // 忽略生成字段 - updated_by_name - 更新人名称;修改人名称冗余存储

        // 忽略生成字段 - updated_time - 更新时间

        // 忽略生成字段 - revision - 乐观锁;用于数据并发操作时使用,数据每次更新后，改变此值

        // 忽略生成字段 - is_deleted - 删除标识;用于标识数据是否逻辑删除(软删) 0:否;1:是
        #endregion 属性

    }
}